<?php

namespace app\store\model;

use think\Model;

/**注册用户模型
 * Class UserLoginModel
 * @package app\store\model
 */
class UserRegModel extends Model
{
    protected $connection = 'db_platform_accounts';

    protected $table = 'accounts_info';

    /**获取指定时间的注册用户
     * @param $where_time
     * @return array
     */
    public static function getUserIds($where_time)
    {
        $data = self::where('RegisterDate', 'between', $where_time)
            ->column('UserID');

        return $data;
    }


    /**获取指定时间的注册用户的子查询语句
     * @param $where_time
     * @return string
     * @throws \think\exception\DbException
     */
    public static function getUserIdsSubSql($where_time)
    {
        $sql = self::table('qpaccountsdb.accounts_info')->where('RegisterDate', 'between', $where_time)
            ->field('UserID')
            ->buildSql();

        return $sql;
    }
}